package com.qingcheng.controller;

import com.qingcheng.entity.PageResult;
import com.qingcheng.entity.Result;
import com.qingcheng.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService stockService;

    @GetMapping("findAllStock")
    public Result findAllStock(String name,String date1,Integer page, Integer size) {
        PageResult<Map> allStock = this.stockService.findAllStock(name,date1,page, size);
        return  new Result(200,"查询成功",allStock);
    }

    @GetMapping("findOutStock")
    public  Result findOutStock(String name,String date1,Integer page, Integer size){
        PageResult<Map> outStock = this.stockService.findOutStock(name, date1, page, size);
        return new Result(200,"查询成功",outStock);
    }

}
